import {useMemo} from 'react'
import { useSearchUIState } from '../../../../../store/hooks/useSearchUIState';
// 获取Ecm获取搜索企业库、团队库、个人库  根据文件路径进行判断
export const useEcmSearchLocation = () => {
  const { selectShowTab } = useSearchUIState();
  return useMemo(() => {
    let searchLocation = 'enterprise'; // 企业库
    const folderPath = selectShowTab?.selectFolderID || '';
    if (folderPath === '7' || folderPath.indexOf('7\\') > -1) {
      searchLocation = 'team'; // 团队库
    }
    if (folderPath === '-99999') {
      // 个人库
      searchLocation = 'person';
    }
    return searchLocation;
  }, [selectShowTab]);
};
